package com.library.lockConsumer.user;

import com.library.lockProvider.service.StuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    StuInfoService stuInfoService;

    @GetMapping("/logining")
    @ResponseBody
    public String loginging(String s_id,String password){

        if(stuInfoService.findStuInfoByIdAndPassword(s_id,password)!=null){
            return "成功";
        }else {
            return "失败";
        }
    }

    @GetMapping("/updatePassword")
    public int updatePassword(String s_id,String password){
        //System.err.println(s_id+" "+password);
        return stuInfoService.updateStudentPassword(s_id,password);
    }


}
